
let express = require('./express');

// 监听函数 http.createServer(function());
let app = express();
app.get('/',function (req, res) {
  res.end('hello world!')
});
app.get('/hello',function (req, res) {
  res.end('hello!')
});
app.post('/',function (req, res) {
  res.end('post home');
})
app.get('/user/:id/:name',function (req, res) {
  res.end(JSON.stringify(req.params))
})

app.all('*',function (req, res) {
  res.end('404');
})
app.listen(3000,()=>{
  console.log(`start 3000.`)
});

